package com.winning.bdu.collect.service.impl;

import com.winning.bdu.collect.service.IJdbcService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by 何强
 * date 2019/5/16
 * description
 */
@Service
@Slf4j
public class JdbcServiceImpl implements IJdbcService {

    @Autowired
    JdbcTemplate jdbcTemplate;

    @Override
    public List<Map<String, Object>> getPageList(String tableName, int startNum, int endNum) {
        List<Map<String, Object>> list = jdbcTemplate.queryForList("select * FROM "+tableName);
        return list;
    }
}
